home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: pointers and functions
- Date: Wed, 27 Mar 96 00:58:51 GMT
- Organization: none
- Message-ID: <827888331snz@genesis.demon.co.uk>
- References: <4j6dol$58g@news.bu.edu> <4j8iqs$9n9@mozo.cc.purdue.edu>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4j8iqs$9n9@mozo.cc.purdue.edu>
- pacman@hillres151.cc.purdue.edu "PacMan" writes:
-
- >The problem is that Maze is a local variable. It only exists inside the
- >function readMaze. When you return its address, readMaze is finished, and its
- >local variables disappear, and the calling function is left with a pointer to
- >some data that isn't there anymore. After that, anything can happen-- bus
- >errors, segmentation faults, the end of the universe...
-
- Nostradamus was a C programmer.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-